﻿@model MVCApp.Models.District

@{
    ViewBag.Title = @Strings.DistrictEdit;
}

<h2>@Strings.DistrictEdit</h2>

@using (Html.BeginForm("Edit", "DistrictManage", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>District</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Number)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Number)
            @Html.ValidationMessageFor(model => model.Number)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostCodeFirst)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostCodeFirst)
            @Html.ValidationMessageFor(model => model.PostCodeFirst)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostCodeLast)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostCodeLast)
            @Html.ValidationMessageFor(model => model.PostCodeLast)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SearchPhrase)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SearchPhrase)
            @Html.ValidationMessageFor(model => model.SearchPhrase)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.AssignedTo.UserName)
        </div>
        <div class="editor-field">
            @Html.DropDownList("AssignedToUserId", String.Empty)
            @Html.ValidationMessageFor(model => model.AssignedToUserId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DistrictBoundaryKml)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DistrictBoundaryKml)<br />
            <input type="file" name="kmlFile" />
            @Html.ValidationMessageFor(model => model.DistrictBoundaryKml)
        </div>

        <p>
            <input type="submit" value="@Strings.Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink(Strings.BackToList, "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
